Optimized Creation of Distributed Storage and Distributed Processing Clusters on Demand

ABSTRACT

A mechanism is provided in a data processing system for creating clusters on demand. The mechanism installs a cluster on the data processing system. The cluster comprises a master node and a managed node having distributed software installed thereon. The mechanism stores state of cluster on external volumes and removes references specific to the cluster from the state of the cluster stored on the external volumes. The mechanism takes a snapshot of the state of the cluster stored on the external volumes to form a set of volume templates and takes a snapshot of images of the master node and the managed node to form a set of node type images. Responsive to receiving a request to create a specified cluster, the mechanism creates a new set of nodes on the data processing system based on the set of node type images, clones the set of volume templates to form a new set of volumes in the data processing system, mounts the new set of volumes to the new set of nodes, and recreates configurations based on details in the request.

BACKGROUND

The present application relates generally to an improved data processingapparatus and method and more specifically to mechanisms for optimizedcreation of distributed storage and distributed processing clusters ondemand.

Apache Hadoop is an open-source software framework for distributedstorage and distributed processing of very large data sets on computerclusters built from commodity hardware. All the modules in Hadoop aredesigned with a fundamental assumption that hardware failures are commonand should be automatically handled by the framework. The core of ApacheHadoop consists of a storage part, known as Hadoop Distributed FileSystem (HDFS), and a processing part called MapReduce. Hadoop splitstiles into large blocks and distributes them across nodes in a cluster.To process data, Hadoop transfers packaged code for nodes to process inparallel based on the data that needs to be processed. This approachtakes advantage of data locality—nodes manipulating the data. to whichthey have access—to allow the dataset to be processed faster and moreefficiently than it would in a more conventional supercomputerarchitecture that relies on a parallel file system where computation anddata are distributed via high-speed networking.

-   -   The base Apache Hadoop framework is composed of the following        modules:    -   Hadoop Common—contains libraries and utilities needed by other        Hadoop modules;    -   Hadoop Distributed File System (HDFS)—a distributed file-system        that stores data on commodity machines, providing very high        aggregate bandwidth across the cluster;    -   Hadoop YARN—a resource-management platform responsible for        managing computing resources in clusters and using them for        scheduling of users' applications; and    -   Hadoop MapReduce—an implementation of the Map Reduce programming        model for large scale data processing.

A clustered file system is a file system that is shared by beingsimultaneously mounted on multiple servers. There are several approachesto clustering, most of which do not employ a clustered file system, onlydirect attached storage for each node. Clustered file systems canprovide features like location-independent addressing and redundancy,which improve reliability or reduce the complexity of the other parts ofthe cluster. Parallel file systems are a type of clustered file systemthat spread data across multiple storage nodes, usually for redundancyor performance.

Distributed file systems do not share block level access to the samestorage but use a network protocol. These are commonly known as networkfile systems, even though they are not the only file systems that usethe network to send data. Distributed file systems can restrict accessto the file system depending on access lists or capabilities on both theservers and the clients, depending on how the protocol is designed.

A distributed computing system is a model in which components located onnetworked computers communicate and coordinate their actions by passingmessages. The components interact with each other in order to achieve acommon goal. Three significant characteristics of distributed systemsare: concurrency of components, lack of a global clock, and independentfailure of components. Examples of distributed systems vary fromSOA-based systems to massively multiplayer online games to peer-to-peerapplications.

SUMMARY

This Summary is provided to introduce a selection of concepts in asimplified form that are further described herein in the DetailedDescription. This Summary is not intended to identify key factors oressential features of the claimed subject matter, nor is it intended tobe used to limit the scope of the claimed subject matter.

In one illustrative embodiment, a method, in a data processing system,for creating clusters of containers on demand. The method comprisesinstalling a cluster on the data processing system, the clustercomprising one or more master/manager nodes and one or more managednodes like data nodes. The method further comprises storing state ofcluster on external volumes and removing references specific to thecluster from the state of the cluster stored on the external volumes.The method further comprises taking a snapshot of the state of thecluster stored on the external volumes to form a set of volume templatesand taking a snapshot of images of the master node and the managed nodeto form a set of node type images. The method further comprises,responsive to receiving a request to create a specified cluster,creating a new set of nodes on the data processing system based on theset of node type images, cloning the set of volume templates to form anew set of volumes in the data processing system, mounting the new setof volumes to the new set of nodes, and recreating configurations basedon details in the request.

In other illustrative embodiments, a computer program product comprisinga computer useable or readable medium having a computer readable programis provided. The computer readable program, when executed on a computingdevice, causes the computing device to perform various ones of, andcombinations of, the operations outlined above with regard to the methodillustrative embodiment.

In yet another illustrative embodiment, a system/apparatus is provided.The system/apparatus may comprise one or more processors and a memorycoupled to the one or more processors. The memory may compriseinstructions which, when executed by the one or more processors, causethe one or more processors to perform various ones of, and combinationsof, the operations outlined above with regard to the method illustrativeembodiment.

These and other features and advantages of the present invention will bedescribed in, or will become apparent to those of ordinary skill in theart in view of, the following detailed description of the exampleembodiments of the present invention.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention, as well as a preferred mode of use and further objectivesand advantages thereof, will best be understood by reference to thefollowing detailed description of illustrative embodiments when read inconjunction with the accompanying drawings, wherein:

FIG. 1 is an example diagram of a distributed data processing system inwhich aspects of the illustrative embodiments may be implemented;

FIG. 2 is an example block diagram of a computing device in whichaspects of the illustrative embodiments may be implemented;

FIG. 3A depicts an example of a virtual machine environment in whichaspects of the illustrative embodiments may be incorporated;

FIG. 3B depicts an example of a container environment in which aspectsof the illustrative embodiments may be incorporated;

FIG. 4 is a block diagram depicting a Hadoop nodes as Docker containersin accordance with an illustrative embodiment;

FIG. 5 depicts example clusters using containers in accordance with anillustrative embodiment;

FIG. 6 is a block diagram depicting a plurality of clusters spanning aplurality of hosts in accordance with an illustrative embodiment;

FIG. 7 is a block diagram illustrating a mechanism for creatingtemplates and images for provisioning clusters on demand in accordancewith an illustrative embodiment;

FIG. 8 is a block diagram illustrating a mechanism for provisioningclusters on demand in accordance with an illustrative embodiment;

FIG. 9 is a flowchart illustrating operation of a mechanism for creatingtemplates and images for provisioning clusters on demand in accordancewith an illustrative embodiment; and

FIG. 10 is a flowchart illustrating operation of a mechanism forprovisioning clusters on demand in accordance with an illustrativeembodiment.

DETAILED DESCRIPTION

A Hadoop cluster consists of multiple machines. Typically, it takes along duration of time to create a Hadoop cluster anywhere from hours fora small cluster to weeks for a large cluster. When Hadoop is offered asa cloud service, it is imperative to provision a cluster quickly and notlet a customer wait for a lengthy period of time. Also, in a cloudenvironment that provides a managed. Hadoop cluster the hosting companyis responsible for availability, maintenance, and frequent patchmanagement with least down time.

The illustrative embodiments provide mechanisms for creating largeHadoop clusters in a short period of time. In order to successfullyinstall a cluster in a short period of time, the illustrativeembodiments provide a mechanism for separating installed binaries fromstate of the cluster. Upfront binaries are built into virtual machineimages, and state of the cluster is externalized in volume templates.During cluster creation time, pre-built virtual machines with requiredbinaries and pre-populated state are used to assemble the cluster on thefly. As used herein, the term “virtual machine” refers to a virtualmachine or cloud compute instance or a Linux™ container like Docker™container, as will be described in further detail below. Somewhere youmay want to mention this so that we can cover all forms ofvirtualization technology. With this approach, Hadoop clusters can becreated on demand in a highly reliable and consistent fashion. Becausethe binaries are pre-installed and there are very fewer activities to beperformed during the cluster creation, the number of possible failuresand the overall time to create the cluster are significantly reduced.

Before beginning the discussion of the various aspects of theillustrative embodiments, it should first be appreciated thatthroughout, this description the term “mechanism” will be used to referto elements of the present invention that perform various operations,functions, and the like. A “mechanism,” as the term is used herein, maybe an implementation of the functions or aspects of the illustrativeembodiments in the form of an apparatus, a procedure, or a computerprogram product. In the case of a procedure, the procedure isimplemented by one or more devices, apparatus, computers, dataprocessing systems, or the like. In the case of a computer programproduct, the logic represented by computer code or instructions embodiedin or on the computer program product is executed by one or morehardware devices in order to implement the functionality or perform theoperations associated with the specific “mechanism.” Thus, themechanisms described herein may be implemented as specialized hardware,software executing on general purpose hardware, software instructionsstored on a medium such that the instructions are readily executable byspecialized or general purpose hardware, a procedure or method forexecuting the functions, or a combination of any of the above.

The present description and claims may make use of the terms “a,” “atleast one of,” and “one or more of” with regard to particular featuresand elements of the illustrative embodiments. It should be appreciatedthat these terms and phrases are intended to state that there is atleast one of the particular feature or element present in the particularillustrative embodiment, but that more than one can also be present.That is, these terms/phrases are not intended to limit the descriptionor claims to a single feature/element being present or require that aplurality of such features/elements be present. To the contrary, theseterms/phrases only require at least a single feature/element with thepossibility of a plurality of such features/elements being within thescope of the description and claims.

Moreover, it should be appreciated that the use of the term “engine,” ifused herein with regard to describing embodiments and features of theinvention, is not intended to be limiting of any particularimplementation for accomplishing and/or performing the actions, steps,processes, etc., attributable to and/or performed by the engine. Anengine may be, but is not limited to, software, hardware and/or firmwareor any combination thereof that performs the specified functionsincluding, but not limited to, any use of a general and/or specializedprocessor in combination with appropriate software loaded or stored in amachine readable memory and executed by the processor. Further, any nameassociated with a particular engine is, unless otherwise specified, forpurposes of convenience of reference and not intended to be limiting toa specific implementation. Additionally, any functionality attributed toan engine may be equally performed by multiple engines, incorporatedinto and/or combined with the functionality of another engine of thesame or different type, or distributed across one or more engines ofvarious configurations.

In addition, it should be appreciated that the following descriptionuses a plurality of various examples for various elements of theillustrative embodiments to further illustrate example implementationsof the illustrative embodiments and to aid in the understanding of themechanisms of the illustrative embodiments. These examples intended tobe non-limiting and are not exhaustive of the various possibilities forimplementing the mechanisms of the illustrative embodiments. It will beapparent to those of ordinary skill in the art in view of the presentdescription that there are many other alternative implementations forthese various elements that may be utilized in addition to, or inreplacement of, the examples provided herein without departing from thespirit and scope of the present invention.

The illustrative embodiments may be utilized in many different types ofdata processing environments. In order to provide a context for thedescription of the specific elements and functionality of theillustrative embodiments, FIGS. 1 and 2 are provided hereafter asexample environments in which aspects of the illustrative embodimentsmay be implemented. It should be appreciated that FIGS. 1 and 2 are onlyexamples and are not intended to assert or imply any limitation withregard to the environments in which aspects or embodiments of thepresent invention may be implemented. Many modifications to the depictedenvironments may be made without departing from the spirit and scope ofthe present invention.

FIG. 1 depicts a pictorial representation of an example distributed dataprocessing system in which aspects of the illustrative embodiments maybe implemented. Distributed data processing system 100 may include anetwork of computers in which aspects of the illustrative embodimentsmay be implemented. The distributed data processing system 100 containsat least one network 102, which is the medium used to providecommunication links between various devices and computers connectedtogether within distributed data processing system 100. The network 102may include connections, such as wire, wireless communication links, orfiber optic cables.

In the depicted example, server 104 and server 106 are connected tonetwork 102 along with storage unit 108. In addition, clients 110, 112,and 114 are also connected to network 102. These clients 110, 112, and114 may be, for example, personal computers, network computers, or thelike. In the depicted example, server 104 provides data, such as bootfiles, operating system images, and applications to the clients 110,112, and 114. Clients 110, 112, and 114 are clients to server 104 in thedepicted example. Distributed data processing system 100 may includeadditional servers, clients, and other devices not shown.

In the depicted example, distributed data processing system 100 is theInternet with network 102 representing a worldwide collection ofnetworks and gateways that use the Transmission ControlProtocol/Internet Protocol (TCP/IP) suite of protocols to communicatewith one another. At the heart of the Internet is a backbone ofhigh-speed data communication lines between major nodes or hostcomputers, consisting of thousands of commercial, governmental,educational and other computer systems that route data and messages. Ofcourse, the distributed data processing system 100 may also beimplemented to include a number of different types of networks, such asfor example, an intranet, a local area network (LAN), a wide areanetwork (WAN), or the like. As stated above, FIG. 1 is intended as anexample, not as an architectural limitation for different embodiments ofthe present invention, and therefore, the particular elements shown inFIG. 1 should not be considered limiting with regard to the environmentsin which the illustrative embodiments of the present invention may beimplemented.

As shown in FIG. 1, one or more of the computing devices, e.g., server104, may be specifically configured to implement a software frameworkfor distributed storage and distributed processing of very large datasets on computer clusters built from commodity hardware. The configuringof the computing device may comprise the providing of applicationspecific hardware, firmware, or the like to facilitate the performanceof the operations and generation of the outputs described herein withregard to the illustrative embodiments. The configuring of the computingdevice may also, or alternatively, comprise the providing of softwareapplications stored in one or more storage devices and loaded intomemory of a computing device, such as server 104, for causing one ormore hardware processors of the computing device to execute the softwareapplications that configure the processors to perform the operations andgenerate the outputs described herein with regard to the illustrativeembodiments. Moreover, any combination of application specific hardware,firmware, software applications executed on hardware, or the like, maybe used without departing from the spirit and scope of the illustrativeembodiments.

It should be appreciated that once the computing device is configured inone of these ways, the computing device becomes a specialized computingdevice specifically configured to implement the mechanisms of theillustrative embodiments and is not a general purpose computing device.Moreover, as described hereafter, the implementation of the mechanismsof the illustrative embodiments improves the functionality of thecomputing device and provides a useful and concrete result thatfacilitates an optimized mechanism for creating clusters on demand oncomputing devices in the distributed data processing system 100.

These computing devices, or data processing systems, may comprisevarious hardware elements which are specifically configured, eitherthrough hardware configuration, software configuration, or a combinationof hardware and software configuration, to implement one or more of thesystems/subsystems described herein. FIG. 2 is a block diagram of justone example data processing system in which aspects of the illustrativeembodiments may be implemented. Data processing system 200 is an exampleof a computer, such as server 104 in FIG. 1, in which computer usablecode or instructions implementing the processes and aspects of theillustrative embodiments of the present invention may be located and/orexecuted so as to achieve the operation, output, and external affects ofthe illustrative embodiments as described herein.

In the depicted example, data processing system 200 employs a hubarchitecture including north bridge and memory controller hub (NB/MCH)202 and south bridge and input/output (I/O) controller hub (SB/ICH) 204.Processing unit 206, main memory 208, and graphics processor 210 areconnected to NB/MCH 202, Graphics processor 210 may be connected toNB/MCH 202 through an accelerated graphics port (AGP).

In the depicted example, local area network (LAN) adapter 212 connectsto SB/ICH 204. Audio adapter 216, keyboard and mouse adapter 220, modem222, read only memory (ROM) 224, hard disk drive (HDD) 226, CD-ROM drive230, universal serial bus (USB) ports and other communication ports 232,and PCI/PCIe devices 234 connect to SB/ICH 204 through bus 238 and bus240. PCI/PCIe devices may include, for example, Ethernet adapters,add-in cards, and PC cards for notebook computers. PCI uses a card buscontroller, while PCIe does not. ROM 224 may be, for example, a flashbasic input/output system (BIOS).

HDD 226 and CD-ROM drive 230 connect to SB/ICH 204 through bus 240. HDD226 and CD-ROM drive 230 may use, for example, an integrated driveelectronics (IDE) or serial advanced technology attachment (SATA)interface. Super I/O (SIO) device 236 may be connected to SB/ICH 204.

An operating system runs on processing unit 206. The operating systemcoordinates and provides control of various components within the dataprocessing system 200 in FIG. 2. As a client, the operating system maybe a commercially available operating system such as Microsoft® Windows7®. An object-oriented programming system, such as the Java™ programmingsystem, may run in conjunction with the operating system and providescalls to the operating system from Java™ programs or applicationsexecuting on data processing system 200.

As a server, data processing system 200 may be, for example, an IBMeServer™ System p® computer system, Power™ processor based computersystem, or the like, running the Advanced interactive Executive (AIX®)operating system or the LINUX® operating system. Data processing system200 may be a symmetric multiprocessor (SMP) system including a pluralityof processors in processing unit 206. Alternatively, a single processorsystem may be employed.

Instructions for the operating system, the object-oriented programmingsystem, and applications or programs are located on storage devices,such as HDD 226, and may be loaded into main memory 208 for execution byprocessing unit 206. The processes for illustrative embodiments of thepresent invention may be performed by processing unit 206 using computerusable program code, which may be located in a memory such as, forexample, main memory 208, ROM 224, or in one or more peripheral devices226 and 230, for example.

A bus system, such as bus 238 or bus 240 as shown in FIG. 2, may becomprised of one or more buses. Of course, the bus system may beimplemented using any type of communication fabric or architecture thatprovides for a transfer of data between different components or devicesattached to the fabric or architecture. A communication unit, such asmodem 222 or network adapter 212 of FIG. 2, may include one or moredevices used to transmit and receive data. A memory may be, for example,main memory 208, ROM 224, or a cache such as found in NB/MCH 202 in FIG.2.

As mentioned above, in some illustrative embodiments the mechanisms ofthe illustrative embodiments may be implemented as application specifichardware, firmware, or the like, application software stored in astorage device, such as HDD 226 and loaded into memory, such as mainmemory 208, for executed by one or more hardware processors, such asprocessing unit 206, or the like. As such, the computing device shown inFIG. 2 becomes specifically configured to implement the mechanisms ofthe illustrative embodiments and specifically configured to perform theoperations and generate the outputs described hereafter with regard tothe optimized mechanism for creating clusters on demand.

Those of ordinary skill in the art will appreciate that the hardware inFIGS. 1 and 2 may vary depending on the implementation. Other internalhardware or peripheral devices, such as flash memory, equivalentnon-volatile memory, or optical disk drives and the like, may be used inaddition to or in place of the hardware depicted in FIGS. 1 and 2. Also,the processes of the illustrative embodiments may be applied to amultiprocessor data processing system, other than the SMP systemmentioned previously, without departing from the spirit and scope of thepresent invention.

Moreover, the data processing system 200 may take the form of any of anumber of different data processing systems including client computingdevices, server computing devices, a tablet computer, laptop computer,telephone or other communication device, a personal digital assistant(PDA), or the like. In some illustrative examples, data processingsystem 200 may be a portable computing device that is configured withflash memory to provide non-volatile memory for storing operating systemfiles and/or user-generated data, for example. Essentially, dataprocessing system 200 may be any known or later developed dataprocessing system without architectural limitation.

FIG. 3A depicts an example of a virtual machine environment in whichaspects of the illustrative embodiments may be incorporated. A virtualmachine (VM) is an emulation of a computer system. Virtual machines arebased on computer architectures and provide functionality of a physicalcomputer. Their implementations may involve specialized hardware,software, or a combination. There are different kinds of virtualmachines, each with different functions:

-   -   System virtual machines (also termed full virtualization VMs)        provide a substitute for a real machine. They provide        functionality needed to execute entire operating systems. A        hypervisor uses native execution to share and manage hardware,        allowing for multiple environments which are isolated from one        another, yet exist on the same physical machine. Modern        hypervisors use hardware-assisted virtualization,        virtualization-specific hardware, primarily from the host        central processing units (CPUs).    -   Process virtual machines are designed to execute computer        programs in a platform-independent environment.

Infrastructure 310 comprises computing resources including computingdevices 311 (e.g., servers, processing units), storage systems 312(e.g., hard disk drives), and networking resources 313 (e.g., networkadapters). Host operating system 320 executes on infrastructure 310, andhypervisor 330 executes on operating system 320, Hypervisor 330 createsand manages virtual machines 340, 350, 360. As an example, virtualmachine 360 runs a guest operating system (OS) 361, binaries andlibraries 362, and an application (APP 3) 363. In accordance with theillustrative embodiments, virtual machines 340, 350, 360 havedistributed software installed thereon, such as Hadoop software.

A hypervisor or virtual machine monitor (VMM) is a piece of computersoftware, firmware, or hardware that creates and runs virtual machines.A computer on which a hypervisor runs one or more virtual machines iscalled a host machine, and each virtual machine is called a guestmachine. The hypervisor presents the guest operating systems (e.g.,guest OS 361) with a virtual operating platform and manages theexecution of the guest operating systems. Multiple instances of avariety of operating systems may share the virtualized hardwareresources. This contrasts with operating-system-level virtualization,where all instances (usually called “containers”) must share a singlekernel, though the guest operating systems can differ in user space,such as different Linux™ distributions with the same kernel.

FIG. 3B depicts an example of a container environment in which aspectsof the illustrative embodiments may be incorporated. As an example,Docker™ is an open-source project that automates the deployment ofapplications inside software containers. Docker™ containers wrap up apiece of software in a complete filesystem that contains everything itneeds to run: code, runtime, system tools, system libraries—anything youcan install on a server. This guarantees that it will always run thesame, regardless of the environment in which it is running.

Similar to the virtual machine environment of FIG. 3A, infrastructure310 comprises computing resources including computing devices 311 (e.g.,servers, processing units), storage systems 312 (e.g., hard diskdrives), and networking resources 313 (e.g., network adapters).Operating system 320 executes on infrastructure 310. In the containerenvironment of FIG. 3B, container engine 335 executes on operatingsystem 320. Container engine 335 creates and manages containers 370,380, 390. Docker™ provides an additional layer of abstraction andautomation of operating-system-level virtualization on the operatingsystem 320. Docker™ uses the resource isolation features of theoperating system kernel to allow independent “containers” 370, 380, 390to run within a single operating system instance, avoiding the overheadof starting and maintaining virtual machines. In the depicted example,container 390 includes binaries and libraries 391, and an application(APP 3) 392, for instance. In accordance with the illustrativeembodiments, containers 370, 380, 390 have distributed softwareinstalled thereon, such as Hadoop software.

The term “virtual node,” as used herein, is a virtualized implementationof a node including binaries, libraries, and at least one application.In one embodiment, as shown in FIG. 3A, a virtual node may be a virtualmachine (VM), which includes a guest operating system, binaries andlibraries, and at least one application. In an alternative embodiment,as shown in FIG. 3B, a virtual node may be a container, which includesbinaries, libraries, and at least one application.

FIG. 4 is a block diagram depicting Hadoop nodes as Docker™ containersin accordance with an illustrative embodiment. A Hadoop clustercomprises a plurality of nodes including one or more master nodes andone or more managed nodes. A data node is an example of a managed node.In the depicted example, data node 410 is a container with data insidethe container 420, state 430, and Hadoop distributed file system (HEWS)data 440. The data inside the container 420 is transient, while thestate 430 and HDFS data 440 are persistent.

FIG. 5 depicts example clusters using containers in accordance with anillustrative embodiment. In the depicted example, cluster A 510 includesone master node and two data nodes; cluster B 520 includes one masternode and three data nodes; and, cluster C 530 includes one master nodeand four data nodes. Each cluster 510, 520, 530 has a respective networkboundary, in accordance with the illustrative embodiment, each clusternode is a virtual node implemented as a container. Each cluster 510,520, 530 has multiple nodes/containers spanning multiple hosts.

In one embodiment, the containers 510, 520, 530 run on a plurality ofbare metal hosts. Bare machine (or bare metal), in computer parlance,means a computer without its operating system. Modern operating systemsevolved through various stages, from elementary to the present-daycomplex, highly sensitive real-time systems. After the development ofprogrammable computers, which did not require physical changes to rundifferent programs, but prior to the development of operating systems,programs were fed to the computer system directly using machine languageby the programmers without any system software support. This approach istermed the “bare machine” approach in the development of operatingsystems. Today it is mostly applicable to embedded systems and firmware,while everyday programs are run by a runtime system within an operatingsystem. In this case, a bare metal host is a machine with an embeddedoperating system and container engine, such as by firmware.

FIG. 6 is a block diagram depicting a plurality of clusters spanning aplurality of hosts in accordance with an illustrative embodiment.Clusters 601, 602, 603 span hosts 610, 620, 630. Cluster A 601 includesa master node and two data nodes executing on host 1 610. Cluster B 602includes a master node and two data nodes executing on host 2 620, aswell as one data node executing on host 1 610. Cluster C 603 includes amaster node and three data nodes executing on host 3 630, as well as onedata node executing on host 2 620.

FIG. 7 is a block diagram illustrating a mechanism for creatingtemplates and images for provisioning clusters on demand in accordancewith an illustrative embodiment. Infrastructure 710 comprises computingresources including computing devices (e.g., servers, processing units),storage systems (e.g., hard disk drives), and networking resources(e.g., network adapters). Operating system 720 executes oninfrastructure 710. In the container environment of FIG. 7, containerengine 730 executes on operating system 720.

In accordance with an illustrative embodiment, the mechanism firstinstalls a two-node cluster 740 with one master node 741 and onedata/slave node 742 on two containers. This cluster 740 is referred toherein as the “golden cluster.” While installing the golden cluster, themechanism installs all required binaries and libraries on containers741, 742.

The mechanism externalizes the state 745 of the cluster 740, whichincludes configurations, metadata, and initial state of the distributedfile system. In one example embodiment, the mechanism runs Hadoop nodesin Docker containers. The container can crash at any time; hence, it isbest practice to not keep any state information inside a container. Bydoing so, the mechanism can let the containers be stopped, restarted, orauto restarted without any worry. In other words, containers should bemade re-entrant. Additionally, there is another potential use case of“hibernation” of clusters. If a user does not want to use a cluster,then the user should be able to hibernate the cluster. When the userwants to resume the cluster, then the cluster should retain data andstate and act as if it was just stopped, but without consuming anyresources. This requirement requires isolation of state from thebinaries.

For an input/output processing (IOP) cluster, all metadata of variousservices is in one or more databases. The logs are under /var/logs/(with the exception of BigSQL).

The mechanism may consolidate all metadata into one database (DB). Fornow, the metadata for all services (except BigSheets and DB2) are storedin MySQL. BigSheets stores the metadata in an Apache Derby DB in a fixedlocation. BigSQL stores metadata in DB2 databases.

The mechanism stores the state of the cluster 745 on volumes 750 outsideof the containers. In the Docker™ world, storage is typicallyexternalized through volumes. A volume is any directory on the hostsystem that is made accessible to a container just like how a filesystem is mounted. Thus, the volume is external to a container andpersists data beyond a container's lifetime.

To mount a volume in Docker™ run, one must do the following:

-   -   docker run -v /host/dir:/container/mydir

The mechanism may use volumes for storing different stateentities—metadata, logs, and HDFS data. Following is the placement oflogs, metadata, and data.

Master Node

Volume:

-   -   MySQL tablespace    -   BigSQL tablespace    -   Derby tablespace

Volume:

-   -   Namenode data    -   Secondary Namenode data

Volume:

-   -   Logs

Data Node

Volume:

-   -   HDFS data

Volume:

-   -   Logs

Volume:

-   -   BigSQL tablespace

Then, the mechanism removes all references specific to the goldencluster 740 from the metadata and configurations, resulting in goldenvolume templates 770, which maintain a pristine state of the cluster 740that is devoid of any details specific to a particular cluster instance.The mechanism takes snapshots of different volumes containingconfiguration, metadata, and initial state of the distributed filesystem and other metadata to generate golden volume templates 770.

Also, the mechanism takes a snapshot of the containers 741, 742 ascontainer images 760. The snapshot results in one image per type ofnode: master container image 761 and data/slave container image 762.These images 761, 762 are referred to herein as golden cluster images760.

FIG. 8 is a block diagram illustrating a mechanism for provisioningclusters on demand in accordance with an illustrative embodiment.Container engine 830 receives golden cluster images 860 and goldenvolume templates 870. In response to receiving a request to create acluster with specific nodes and a specific service topology, containerengine 830 creates a new set of containers based on golden clusterimages 860. In the example depicted in FIG. 8, container engine 830creates master node container 841 from master container image 861 andcreates data/slave node containers 842, 843 from data/slave containerimage 862. Also, container engine 830 clones golden volume templates 870to form volumes 850 and mounts volumes 850 onto the containers 841, 842,843. Next, the mechanism recreates configurations based on the clusterrequest details, such as roles of nodes, size of nodes, and number ofnodes. Now, when cluster services are started, the cluster comes alivein a manner of four to five minutes.

In accordance with one embodiment, there may be a plurality of sets ofgolden cluster images 860 and golden volume templates 870 for varioustypes and roles of nodes.

The mechanism allocates fixed space to each volume so that the mechanismcan set a space quota for a cluster's logs, data, and metadata, etc.While a volume looks like a mount point inside a container, it is a meredirectory on the host machine's file system. Hence, by creating multipledirectories under the same host partition, the mechanism cannot set aquota. One option is to create a partition per volume. While it seems anobvious choice, there are some possible limitations.

-   -   The mechanism supports multiple clusters per a large bare metal        machine. Even after un-provisioning a cluster, the mechanism may        have to keep the volume intact until a grace period is over.        Thus, the mechanism does not know upfront how many partitions to        create. Then, the mechanism needs to create partitions on the        fly when creating or reloading a cluster. However, creating a        partition and formatting may take some time, thereby creating        cluster creation time overall.    -   Creating a partition sets aside a fixed space, whether that much        is used by the cluster or not.    -   The mechanism may have to backup metadata and/or data        volume/partition, in case the mechanism is to support a bare        metal failing.

Considering these limitations, one option is to base the file system ona sparse file, the same technique that Docker™ uses internally for thecontainer file system. A sparse file is a file that attempts to use filesystem space more efficiently when the file itself is mostly empty. Themechanism creates a very large sparse file, e.g., 20 GB, by filling onlyzeroes. While it shows the file size as 20 GB upon “1 s−1”, the sparsefile occupies only few bytes initially. As the mechanism adds real datato the sparse file, the file starts occupying the real disk space. Itcan grow up to the size the mechanism would have defined when creatingthe sparse file. The sparse file does not grow beyond the specifiedsparse file size. Linux™ provides another capability to treat any fileas a block device and create a file system on it much like creating apartition.

-   -   dd of=my-sp-file bs=1M seek=5120 count=0—Creates a sparse file        of 5 GB    -   mkfs.ext3 my-sp-file—Create a file system    -   mkdir test-mount-dir—Create a mount directory    -   mount -o loop my-sp-file test-mount-dir—Mount the file system

Making use of the two concepts the mechanism can create a file systemfrom a sparse file to serve the volumes. The sparse file helps inutilizing the disk space efficiently—it occupies only as much disk spaceas used by the cluster. The sparse file also helps in restricting themaximum size of the volume. Once the mechanism creates a file systemusing a sparse file and writes contents into the file system, moving thecontents is as simple as moving the sparse file. This helps in backupand hibernation as well. Additionally, while creating a new cluster, themechanism can simply create a new volume needed by the cluster from amaster-copy of prepared volume (another sparse file), mount it on adirectory and attach it as a volume and bring up container.

Comparing the input/output performance of using sparse file basedvolumes and partition based volumes, the numbers are comparable. In afew cases, the performance of sparse file was marginally lesser comparedto partitions.

Analyzing the pros and cons of both, the mechanism gets far morebenefits by going with sparse file based approach.

The sparse files will be placed in the host, where in the host directorythey will be mounted, and how the mechanism associates then withclusters are as follows:

The present invention may be a system, a method, and/or a computerprogram product. The computer program product may include a computerreadable storage medium (or media) having computer readable programinstructions thereon for causing a processor to carry out aspects of thepresent invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firework, switches, gateway computers and/or edgeservers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Java, Smalltalk, C++ or the like,and conventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local area network (LAN) or a wide areanetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

FIG. 9 is a flowchart illustrating operation of a mechanism for creatingtemplates and images for provisioning clusters on demand in accordancewith an illustrative embodiment. Operation begins (block 900), and themechanism installs a two-node cluster having one master node and onedata/slave node on two containers with a base operating system (block901). This two-node cluster is referred to herein as the “goldencluster.” The mechanism installs binaries and libraries on the containerand installs state on external volumes (block 902). The mechanismremoves references specific to the golden cluster from metadata andconfigurations (block 903). The mechanism then takes snapshots of thevolumes to form golden volume templates (block 904) and takes snapshotsof the container images to form golden cluster images (block 905).Thereafter, operation ends (block 906).

FIG. 10 is a flowchart illustrating operation of a mechanism forprovisioning clusters on demand in accordance with an illustrativeembodiment. Operation begins (block 1000), and the mechanism receives arequest to create a cluster with specific nodes and specific servicetopology (block 1001). The mechanism creates a new set of containersbased on the golden cluster images (block 1002) and creates requiredvolumes by cloning the golden volume templates (block 1003). Themechanism then mounts the volumes on the new set of containers (block1004). The mechanism recreates configurations based on the clusterrequest details (block 1005) and starts cluster services (block 1006).Thereafter, operation ends (block 1007).

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

As noted above, it should be appreciated that the illustrativeembodiments may take the form of an entirely hardware embodiment, anentirely software embodiment or an embodiment containing both hardwareand software elements. In one example embodiment, the mechanisms of theillustrative embodiments are implemented in software or program code,which includes but is not limited to firmware, resident software,microcode, etc.

A data processing system suitable for storing and/or executing programcode will include at least one processor coupled directly or indirectlyto memory elements through a communication bus, such as a system bus,for example. The memory elements can include local memory employedduring actual execution of the program code, bulk storage, and cachememories which provide temporary storage of at least some program codein order to reduce the number of times code must be retrieved from bulkstorage during execution. The memory may be of various types including,but not limited to, ROM, PROM, EPROM, EEPROM, DRAM, SRAM, Flash memory,solid state memory, and the like.

Input/output or I/O devices (including but not limited to keyboards,displays, pointing devices, etc.) can be coupled to the system eitherdirectly or through intervening wired or wireless I/O interfaces and/orcontrollers, or the like. I/O devices may take many different formsother than conventional keyboards, displays, pointing devices, and thelike, such as for example communication devices coupled through wired orwireless connections including, but not limited to, smart phones, tabletcomputers, touch screen devices, voice recognition devices, and thelike. Any known or later developed I/O device is intended to be withinthe scope of the illustrative embodiments.

Network adapters may also be coupled to the system to enable the dataprocessing system to become coupled to other data processing systems orremote printers or storage devices through intervening private or publicnetworks. Modems, cable modems and Ethernet cards are just a few of thecurrently available types of network adapters for wired communications.Wireless communication based network adapters may also be utilizedincluding, but not limited to, 802.11 a/b/g/n wireless communicationadapters, Bluetooth wireless adapters, and the like. Any known or laterdeveloped network adapters are intended to be within the spirit andscope of the present invention.

The description of the present invention has been presented for purposesof illustration and description, and is not intended to be exhaustive orlimited to the invention in the form disclosed. Many modifications andvariations will be apparent to those of ordinary skill in the artwithout departing from the scope and spirit of the describedembodiments. The embodiment was chosen and described in order to bestexplain the principles of the invention, the practical application, andto enable others of ordinary skill in the art to understand theinvention for various embodiments with various modifications as aresuited to the particular use contemplated. The terminology used hereinwas chosen to best explain the principles of the embodiments, thepractical application or technical improvement over technologies foundin the marketplace, or to enable others of ordinary skill in the art tounderstand the embodiments disclosed herein.

1. A method, in a data processing system, for creating clusters on demand, the method comprising: installing a cluster on the data processing system, wherein the cluster comprises a master node and a managed node having distributed software installed thereon; storing state of the cluster on external volumes; removing references specific to the cluster from the state of the cluster stored on the external volumes; taking a snapshot of the state of the cluster stored on the external volumes to form a set of volume templates; taking a snapshot of images of the master node and the managed node to form a set of node type images; and responsive to receiving a request to create a specified cluster, creating a new set of nodes on the data processing system based on the set of node type images, cloning the set of volume templates to form a new set of volumes in the data processing system, mounting the new set of volumes to the new set of nodes, and recreating configurations based on details in the request.
 2. The method of claim 1, further comprising starting cluster services for the specified cluster.
 3. The method of claim 1, wherein installing the cluster comprises installing binaries and libraries in the master node and the managed node.
 4. The method of claim 1, wherein the state of the cluster comprises configurations, metadata, and initial distributed file system state.
 5. The method of claim 1, wherein the request specifies roles of nodes, size of nodes, and number of nodes.
 6. The method of claim 1, wherein cloning. the set of volume templates comprises allocating fixed space to each volume and setting a space quota for logs, data, and metadata.
 7. The method of claim 6, wherein cloning, the set of volume templates further comprises creating a file system from a sparse file to serve as the volumes. 8-20. (canceled) 